package com.ursu.shared;


import java.io.Serializable;

import javax.persistence.Id;

import com.googlecode.objectify.condition.IfFalse;

import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Unindexed;

@Entity
public class User implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id Long id;
	private String username;
	private String email;
	private String hashedPassword;
	// The admin field is only indexed when it is true
	private @Unindexed(IfFalse.class)  boolean administrator;
	
	
	// empty constructor for serialization
	public User() {
		
	}
	
	public User(String username) {
		this.username = username;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getHashedPassword() {
		return hashedPassword;
	}
	public void setHashedPassword(String hashedPassword) {
		this.hashedPassword = hashedPassword;
	}
	public boolean isAdministrator() {
		return administrator;
	}
	public void setAdministrator(boolean isAdministrator) {
		this.administrator = isAdministrator;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	
	
	
}
